// pages/login/login.js
import validate from 'wechat-validate'
Page({
  behaviors: [validate],
 data:{
   account:'hdsj001', // 账号
   password:'123456' // 密码
 },
 rules:{
    account: [{
      required: true,
      message: '请填写账号!'
    }
  ],
  password: [{
    required: true,
    message: '请填写账号密码!'
  }],
 },
 cccc(){},
 async Hsubmit(){
    if (!this.validate()) return
    const { __webviewId__,...data } = this.data
    const res = await wx.$http.post('/driver/login/account',data)
    getApp().setToken('token',res)
    wx.reLaunch({
      url: '/pages/index/index',
    })
  }
})